package org.prem.collection;

import java.util.Collections;
import java.util.LinkedList;

/*
 * Linkedlist is ordered by index position
 * 
 * */
public class LinkedListSample {

	public static void main(String[] args){
		LinkedList ll = new LinkedList();
	      ll.add("F");
	      ll.add("B");
	      ll.add("D");
	      ll.add("E");
	      ll.add("C");
	      ll.addLast("Z");
	      ll.addFirst("A");
	      ll.add(1, "A2");
	      ll.add(5, "A3");
	      System.out.println("Original contents of ll: " + ll);
	      Collections.sort(ll);
	      System.out.println("Original contents of ll sortedf: " + ll);
	}
}
